import { ChatroomMessageCodeEnum } from '../enum/ChatroomMessageCodeEnum'

export class ChatroomMessage{
  code:number ;
  message:string;
  username:string;
  timestamp:number = Date.now();
  id:string;
  constructor(code:number,message:string,username:string,id:string) {
    this.code = code;
    this.message = message;
    this.username = username;
    this.id = id;
  }

  public static chat(message:string,username:string,id:string):ChatroomMessage{
    return new ChatroomMessage(ChatroomMessageCodeEnum.NORMAL,message,username,id)
  }

}